/*********************************************************************************
 *      Copyright:  (C) 2015 songyong<handy_skyoutlook.com>
 *                  All rights reserved.
 *
 *       Filename:  gps_data.c
 *    Description:  This file 
 *                 
 *        Version:  1.0.0(2015年08月11日)
 *         Author:  sky <handy_sky@outlook.com>
 *      ChangeLog:  1, Release initial version on "2015年08月11日 11时52分24秒"
 *                 
 ********************************************************************************/
#ifndef GPS_H_
#define GPS_H_
#define UTC  512
#define CTC  512
struct gps
{
    char            utc_time[UTC];
    char            gps_status;
    float           gps_lng;//经度半球
    float           gps_lat;
    char            lng_hemisphere;//经度半球       
    char            lat_hemisphere;
    float           gps_rate;
    char            ctc_time[CTC];
    char            gps_mode;
}; 
/*  Time */
struct Gtime
{
    int         year;
    int         month;
    int         day; 
    int         hour;                                                        
    int         minute;                                                      
    int         second;                                                      
};   

extern int open_port(char *console_name);
extern int set_opt(int fd,int nSpeed, int nBits, char nEvent, int nStop);
extern int analyse(char *buf,struct gps *gs,struct Gtime *tm); 
extern void print(struct gps *gp,struct Gtime *ti); 

#endif
